﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunstreamTV.Tools
{
    public static class CyberGame
    {
        public static async Task<Uri> GetM3U8(string channelName)
        {
            var cybergameResponse = await new Requester().Get<CybergameResponse>("http://api.cybergame.tv/w/streams2.php?channel=" + channelName);
            return new Uri(cybergameResponse.m3u8);
        }
    }

    public class CybergameResponse
    {
        public string channel_game { get; set; }
        public string online { get; set; }
        public string viewers { get; set; }
        public string thumbnail { get; set; }
        public string rtmp { get; set; }
        public string m3u8 { get; set; }
    }
}
